package com.starlight.flower_server.controller.authentication;

import com.starlight.flower_server.domain.service.captcha.CaptchaService;
import com.starlight.flower_server.infrastructure.FlowerServerResponse;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @Author yfy2001
 * @date 2023/4/23 14:46
 */
@RestController
@RequestMapping("/email")
public class EmailController {

    @Resource
    private CaptchaService captchaService;

    @GetMapping("/getCaptcha")
    public FlowerServerResponse<String> getCaptcha(String receiver){
        System.out.println(receiver);
        return FlowerServerResponse.success(captchaService.sendCaptcha(receiver));
    }
}
